﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class sysadmin_CountManager_CoursewareDetail :PowerCreator.LMS.Web.Base.BasePage
{
    PowerCreator.LMS.Web.Project.NewProjectPlan opProjectPlan = new PowerCreator.LMS.Web.Project.NewProjectPlan();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitPage();

            string resourceid = Request.QueryString["ResourceID"].ToString();
            ViewState["ResourceID"] = resourceid;

            string search = GetSearch();
            BinderPager(search);
            BinderRPT(search, 1);
        }
    }

    protected override void InitPage()
    {
        base.InitPage();
    }

    private string GetSearch()
    {
        string search = string.Format("FKSscrlogResourceID={0}", ViewState["ResourceID"]);
        return search;
    }

    private void BinderPager(string search)
    {
        AspNetPager1.PageSize = LMSPageSize;
        AspNetPager1.RecordCount = opProjectPlan.QueryProjectResourceResourceHistoryCount(search);
    }

    private void BinderRPT(string search,int pageIndex)
    {
        DataTable dt = opProjectPlan.QueryProjectResourceResourceHistory(search,LMSPageSize,pageIndex);
        rpt_CoursewareHistory.DataSource = dt;
        rpt_CoursewareHistory.DataBind();
    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        string search = GetSearch();
        BinderRPT(search, AspNetPager1.CurrentPageIndex);
    }
}
